<%@ page language="java" contentType="text/html; charset=utf-8"
    pageEncoding="utf-8"%>
<%@page import ="com.dish.bean.Dish,java.util.*" %>  
  
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html lang="en">
  <head>
    <meta name="description" content="Vali is a responsive and free admin theme built with Bootstrap 4, SASS and PUG.js. It's fully customizable and modular.">
    <!-- Twitter meta-->
    <meta property="twitter:card" content="summary_large_image">
    <meta property="twitter:site" content="@pratikborsadiya">
    <meta property="twitter:creator" content="@pratikborsadiya">
    <!-- Open Graph Meta-->
    <meta property="og:type" content="website">
    <meta property="og:site_name" content="Vali Admin">
    <meta property="og:title" content="Vali - Free Bootstrap 4 admin theme">
    <meta property="og:url" content="http://pratikborsadiya.in/blog/vali-admin">
    <meta property="og:image" content="http://pratikborsadiya.in/blog/vali-admin/hero-social.png">
    <meta property="og:description" content="Vali is a responsive and free admin theme built with Bootstrap 4, SASS and PUG.js. It's fully customizable and modular.">
    <title>肯德鸭-菜品管理</title>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <!-- Main CSS-->
    <link rel="stylesheet" type="text/css" href="css/main.css">
    <!-- Font-icon css-->
    <link rel="stylesheet" type="text/css" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css">
  </head>
  <body class="app sidebar-mini rtl">
    <!-- Navbar-->
    <header class="app-header"><a class="app-header__logo" href="#">Kendeya</a>
      <!-- Sidebar toggle button--><a class="app-sidebar__toggle" href="#" data-toggle="sidebar" aria-label="Hide Sidebar"></a>
      <!-- Navbar Right Menu-->
      <ul class="app-nav">
        <!--Notification Menu-->
       
        <!-- User Menu-->
      </ul>
    </header>
    <!-- Sidebar menu-->
    <div class="app-sidebar__overlay" data-toggle="sidebar"></div>
    <aside class="app-sidebar">

      <ul class="app-menu">
        <li class="treeview is-expanded"><a class="app-menu__item" href="#" data-toggle="treeview"><i class="app-menu__icon fa fa-th-list"></i><span class="app-menu__label">管理界面</span><i class="treeview-indicator fa fa-angle-right"></i></a>
          <ul class="treeview-menu">
          	<li><a class="treeview-item" href="ShowUsers"><i class="icon fa fa-circle-o"></i> 用户管理</a></li>
            <li><a class="treeview-item active" href="ShowDish"><i class="icon fa fa-circle-o"></i> 菜品管理</a></li>
            <li><a class="treeview-item" href="ShowOrder"><i class="icon fa fa-circle-o"></i> 订单管理</a></li>
          </ul>
        </li>
      </ul>
    </aside>
    <main class="app-content">
      <div class="app-title">
        <div>
          <h1><i class="fa fa-th-list"></i>&nbsp;&nbsp;菜品管理</h1>
        </div>
      </div>

      <div class="row">

        <div class="col-md-12">
          <div class="tile">
            <div class="tile-body">
              <table class="table table-hover table-bordered" id="sampleTable">
                <thead>  
                  <tr>
                    <th>图片</th>
                    <th>菜品名</th>
                    <th>菜品ID</th>
                    <th>描述</th>
                    <th>单价</th>
                    <th>操作</th>
                  </tr>
                </thead>
                <%ArrayList<Dish> list = (ArrayList<Dish>)request.getAttribute("lst"); %>
                <tbody>
                <%for(Dish i:list){%>
                  <tr>
                  	<td><img src="<%=i.getImg() %>" width="70" height="70"></td> 
                    <td><%=i.getDishname() %></td>
                    <td><%=i.getDishid() %></td>
					<td><%=i.getDishdesc() %></td>
                    <td><%=i.getPrice() %></td>
                    <td>
						<a onClick="return window.confirm('您确定要删除<%=i.getDishid()%>号菜品么？')" href="deletedish.jsp?id=<%=i.getDishid()%>">删除</a>
                		<a onClick="return window.confirm('您确定要修改<%=i.getDishid()%>号菜品的信息么？')" href="modifydish.jsp?id=<%=i.getDishid()%>&nm=<%=i.getDishname()%>&ds=<%=i.getDishdesc()%>&img=<%=i.getImg()%>&pri=<%=i.getPrice()%>">修改</a>
					</td>
                  </tr>
                <% } %>
                </tbody>
              </table>
            </div>
          </div>
        </div>
      </div>
      <form action="createdish.jsp" method="post">
      	<input class="btn btn-primary" type="submit" name="Submit" value="增加菜品">
      </form>
    </main>
    <!-- Essential javascripts for application to work-->
    <script src="js/jquery-3.2.1.min.js"></script>
    <script src="js/popper.min.js"></script>
    <script src="js/bootstrap.min.js"></script>
    <script src="js/main.js"></script>
    <!-- The javascript plugin to display page loading on top-->
    <script src="js/plugins/pace.min.js"></script>
    <!-- Page specific javascripts-->
    <!-- Data table plugin-->
    <script type="text/javascript" src="js/plugins/jquery.dataTables.min.js"></script>
    <script type="text/javascript" src="js/plugins/dataTables.bootstrap.min.js"></script>
    <script type="text/javascript">$('#sampleTable').DataTable();</script>
    <!-- Google analytics script-->
    <script type="text/javascript">
      if(document.location.hostname == 'pratikborsadiya.in') {
      	(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
      	(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
      	m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
      	})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
      	ga('create', 'UA-72504830-1', 'auto');
      	ga('send', 'pageview');
      }
    </script>
  </body>
</html>